from django.db import models
from mdeditor.fields import MDTextField

# Create your models here.

class Student(models.Model):
	student_intro = MDTextField()
	bool_intro = models.BooleanField()
	name = models.CharField(max_length=10)
	seat_number = models.IntegerField()
	qq_number = models.CharField(max_length=20, blank=True)
	phone_number = models.CharField(max_length=20, blank=True)
	last_edit = models.DateTimeField(auto_now=True)
	last_edit_name = models.CharField(max_length=100)
	html_text = models.TextField(default='')

	def __str__(self):
		return self.name + ' ' + str(self.seat_number)

class Student_last(models.Model):
	student_info = MDTextField()
	qq_number = models.CharField(max_length=20, blank=True)
	phone_number = models.CharField(max_length=20, blank=True)
	last_edit = models.DateTimeField()
	last_edit_name = models.CharField(max_length=100)
	history = models.ForeignKey(Student, on_delete=models.CASCADE, null=True, blank=True, related_name='history')
	html_text = models.TextField(default='')